<?php
//============================================================+
// File name   : HojaVida.php
// Begin       : 2008-03-04
// Last Update : 2010-11-20
//
// Description : Hoja de vida del estudiante, se consulta por cedula
//               WriteHTML and RTL support
//
// Author: Cristian Ruiz Gonzalez
//
// (c) Copyright:
//               Nicola Asuni
//               Tecnick.com LTD
//               Manor Coach House, Church Hill
//               Aldershot, Hants, GU12 4RQ
//               UK
//               www.tecnick.com
//               info@tecnick.com
//============================================================+

/**
 * Creates an example PDF TEST document using TCPDF
 * @package com.tecnick.tcpdf
 * @abstract TCPDF - Example: WriteHTML and RTL support
 * @author Cristian Ruiz
 * @since 2012-05-21
 */
require_once('../lib/tcpdf/config/lang/eng.php');
require_once('../lib/tcpdf/tcpdf.php');

// create new PDF document
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set document information
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('PoliJIC');
$pdf->SetTitle('HOJA DE VIDA');
$pdf->SetSubject('ESTUDIANTE '.$_GET['Nombres']);
$pdf->SetKeywords('TCPDF, PDF, example, test, guide');

// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);

// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));

// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

//set some language-dependent strings
$pdf->setLanguageArray($l);

// ---------------------------------------------------------

// set font
$pdf->SetFont('dejavusans', '', 10);

// add a page
$pdf->AddPage();

// writeHTML($html, $ln=true, $fill=false, $reseth=false, $cell=false, $align='')
// writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=0, $reseth=true, $align='', $autopadding=true)

// create some HTML content
$html = '<h1>HOJA DE VIDA DEL ESTUDIANTE <BR/>'.$_GET['Nombres'].' '.$_GET['Apellidos'].'</h1>
<table>
    <tr>
        <td>
            <h4>Documento</h4>
        </td>
        <td>
            <h4>Nombres</h4>
        </td>
        <td>
            <h4>Apellidos</h4>
        </td>
        <td>
            <h4>Acudiente</h4>
        </td>
    </tr>
    <tr>
        <td>
            '.$_GET['Documento'].'
        </td>
        <td>
            '.$_GET['Nombres'].'
        </td>
        <td>
            '.$_GET['Apellidos'].'
        </td>
        <td>
            '.$_GET['Acudiente'].'
        </td>
    </tr>
    <tr>
        <td>
            <h4>Direccion</h4>
        </td>
        <td>
            <h4>Barrio</h4>
        </td>
        <td>
            <h4>Lugar Nacimiento</h4>
        </td>
        <td>
            <h4>Fecha Nacimiento</h4>
        </td>
    </tr>
    <tr>
        <td>
            '.$_GET['Direccion'].'
        </td>
        <td>
            '.$_GET['Barrio'].'
        </td>
        <td>
            '.$_GET['LNacimiento'].'
        </td>
        <td>
            '.$_GET['FNacimiento'].'
        </td>
    </tr>
    <tr>
        <td>
            <h4>Telefono</h4>
        </td>
        <td>
            <h4>Condicion Salud</h4>
        </td>
        <td>
            <h4>Curso</h4>
        </td>
        <td>
            <h4>Email</h4>
        </td>
    </tr>
    <tr>
        <td>
            '.$_GET['Telefono'].'
        </td>
        <td>
            '.$_GET['CondSalud'].'
        </td>
        <td>
            '.$_GET['Curso'].'
        </td>
        <td>
            '.$_GET['Email'].'
        </td>
    </tr>
    <tr>
        <td>
            <h4>Grupo Sanguineo</h4>
        </td>
        <td>
            <h4>Nro Hermanas</h4>
        </td>
        <td>
            <h4>Nro Hermanos</h4>
        </td>
        <td></td>
    </tr>
    <tr>
        <td>
            '.$_GET['GrpSanguineo'].'
        </td>
        <td>
            '.$_GET['NroHermanos'].'
        </td>
        <td>
            '.$_GET['NroHermanas'].'
        </td>
        <td></td>
    </tr>
</table>';

// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');

// reset pointer to the last page
$pdf->lastPage();


//Close and output PDF document
$pdf->Output('example_006.pdf', 'I');

//============================================================+
// END OF FILE
//============================================================+
